import request from "./request"
import qs from "qs"

export let jingpinApi = () => request.get("/products/recommend")
// 热门推荐
export let HotApi = () => request.get("/products/hot")
// 定义一个发送验证码
export const SendSmSAPI = (params) => request.post("/sendSMS",
    qs.stringify(params))
// 登录请求
export const phoneReginAPI = (params) => request.post("/phoneRegin",
    qs.stringify(params))
// 微信扫码
export const weixinLoginAPI = (params) => request.post("/wechatUsers/PCLogin",
    qs.stringify(params))
// 绑定手机号
export const BinDingAPI = (params) => request.post("/wechatUsers/binding",
    qs.stringify(params))
// 用户信息
export const userProfilesAPI = () => request.get("/shop/userProfiles")
// 商品详情
export const GoodsDetailsAPI = (id) => request.get(`/products/${id}`)
// 商品详情
export const AddToCartsAPI = (params) => request.post("/shop/carts/add",
    qs.stringify(params))

// 更多(先不传值)
export let GoodsSearchApi = (params) => request.get("/products", {
    params
})
//(个人中心购物车)
export let shopCartsApi = () => request.get("/shop/carts")
// 删除购物车/shop/carts?productIds={id}
export let productIdsApi = (id) => request.delete(`/shop/carts?productIds=${id}`)